package lib

//link to 294 464
func init() {
	Probs = append(Probs, Problem{
		Num:         292,
		Discription: "Nim",
		Level:       1,
		Labels: map[string]int{
			"动态规划": 1,
			"数学":   1,
		},
	})
}

func CanWinNim2(n int) bool {
	return n%4 == 0
}

//数字太大会越界
func CanWinNim(n int) bool {
	if n <= 3 {
		return true
	}

	dp := make([]bool, n+1)
	dp[1], dp[2], dp[3] = true, true, true
	for i := 4; i <= n; i++ {
		dp[i] = !(dp[i-1] && dp[i-2] && dp[i-3])
	}

	return dp[n]
}
